﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Model
{
    [SugarTable("Department")]
    public class DepartmentModel : BaseModel
    {
        /// <summary>
        /// 部门名称
        /// </summary>
        [SugarColumn(ColumnName = "DepartmentName", Length = 50, IsNullable = false)]
        public string DepartmentName { get; set; }

        /// <summary>
        /// 部门描述
        /// </summary>
        [SugarColumn(ColumnName = "DepartmentDesc", Length = 200, IsNullable = true)]
        public string DepartmentDesc { get; set; }

        /// <summary>
        /// 状态：0-禁用，1-启用
        /// </summary>
        [SugarColumn(ColumnName = "Status", DefaultValue = "1")]
        public byte Status { get; set; } = 1;

        /// <summary>
        /// 上级部门ID
        /// </summary>
        [SugarColumn(ColumnName = "ParentId", DefaultValue = "0")]
        public long ParentId { get; set; } = 0;

        /// <summary>
        /// 部长ID
        /// </summary>
        [SugarColumn(ColumnName = "Minister", DefaultValue = "0")]
        public long Minister { get; set; } = 0;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "CreateTime", DefaultValue = "GETDATE()")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "UpdateTime", DefaultValue = "GETDATE()")]
        public DateTime UpdateTime { get; set; } = DateTime.Now;
    }

    public class AddDepartmentModelDto
    {
        public string DepartmentName { get; set; }

        public string? DepartmentDesc { get; set; }
    }

    public class UpdateDepartmentModelDto
    {
        public long Id { get; set; }   

        public string DepartmentName { get; set; }

        public string DepartmentDesc { get; set; } = null;

        public byte Status { get; set; } = 1;

        public long ParentId { get; set; }=0;

        public long Minister { get; set; } = 0;
    }
}


